

#ifndef UD_DBOLE_H
#define UD_DBOLE_H

#include "zdbmain.h"
#include "zdbframe.h"
#include "zgepnt3d.h"

#pragma pack (push, 8)

class CRectangle3d
{
public:
    UcGePoint3d upLeft;
    UcGePoint3d upRight;
    UcGePoint3d lowLeft;
    UcGePoint3d lowRight;
};
class CRect;

class UcDbOleFrame: public UcDbFrame
{
public:
    UCDB_DECLARE_MEMBERS(UcDbOleFrame);

    UcDbOleFrame();
    virtual ~UcDbOleFrame();

    virtual Ucad::ErrorStatus dwgInFields(UcDbDwgFiler* filer);
    virtual Ucad::ErrorStatus dwgOutFields(UcDbDwgFiler* filer) const;
    virtual Ucad::ErrorStatus dxfInFields(UcDbDxfFiler* filer);
    virtual Ucad::ErrorStatus dxfOutFields(UcDbDxfFiler* filer) const;
    virtual ZSoft::Boolean worldDraw(UcGiWorldDraw*);
    virtual void viewportDraw(UcGiViewportDraw* mode);
    virtual Ucad::ErrorStatus getGeomExtents(UcDbExtents& extents) const;

    virtual void* getOleObject(void) const;
    virtual void setOleObject(const void *pItem);

};

class UcDbOle2Frame: public UcDbOleFrame
{
public:
    UCDB_DECLARE_MEMBERS(UcDbOle2Frame);
    UcDbOle2Frame();
    virtual ~UcDbOle2Frame();

    virtual Ucad::ErrorStatus dwgInFields(UcDbDwgFiler* filer);
    virtual Ucad::ErrorStatus dwgOutFields(UcDbDwgFiler* filer) const;
    virtual Ucad::ErrorStatus dxfInFields(UcDbDxfFiler* filer);
    virtual Ucad::ErrorStatus dxfOutFields(UcDbDxfFiler* filer) const;

    virtual ZSoft::Boolean worldDraw(UcGiWorldDraw*);
    virtual void viewportDraw(UcGiViewportDraw* mode);
    virtual Ucad::ErrorStatus getGeomExtents(UcDbExtents& extents) const;
    virtual Ucad::ErrorStatus transformBy(const UcGeMatrix3d& xform);
    virtual Ucad::ErrorStatus getTransformedCopy(const UcGeMatrix3d& xform,
						                         UcDbEntity*& ent) const;    
    virtual Ucad::ErrorStatus explode(UcDbVoidPtrArray& entitySet) const;
    virtual Ucad::ErrorStatus getOsnapPoints(UcDb::OsnapMode osnapMode,
                                ZSoft::GsMarker     gsSelectionMark,
                                const UcGePoint3d&  pickPoint,
                                const UcGePoint3d&  lastPoint,
                                const UcGeMatrix3d& viewXform,
                                UcGePoint3dArray&   snapPoints,
                                UcDbIntArray &       geomIds) const;
    virtual Ucad::ErrorStatus	getGripPoints(UcGePoint3dArray&    gripPoints,
								              UcDbIntArray& 	   osnapModes,
								              UcDbIntArray& 	   geomIds) const;
    virtual Ucad::ErrorStatus	moveGripPointsAt(const UcDbIntArray& indices,
								                 const UcGeVector3d& offset);
    virtual Ucad::ErrorStatus	getStretchPoints(UcGePoint3dArray&  stretchPoints) const;
    virtual Ucad::ErrorStatus	moveStretchPointsAt(const UcDbIntArray& indices,
								                    const UcGeVector3d& offset);
  virtual Ucad::ErrorStatus   getSubentPathsAtGsMarker(UcDb::SubentType      type,
                                                       ZSoft::GsMarker       gsMark,
                                                       const UcGePoint3d&    pickPoint,
                                                       const UcGeMatrix3d&   viewXform,
                                                       int&                  numPaths,
                                                       UcDbFullSubentPath*&  subentPaths,
                                                       int                   numInserts = 0,
				                                       UcDbObjectId*         entAndInsertStack = 0
                                                      ) const;

    virtual  Ucad::ErrorStatus getGsMarkersAtSubentPath(
                               const UcDbFullSubentPath& subPath, 
                               UcArray<ZSoft::GsMarker>& gsMarkers) const;

    virtual UcDbEntity*        subentPtr(const UcDbFullSubentPath& id) const;

    UcCmTransparency            transparency() const;
    virtual Ucad::ErrorStatus   setTransparency(const UcCmTransparency& trans,
                                                ZSoft::Boolean doSubents = true);

    UcDb::Visibility            visibility() const;
    virtual Ucad::ErrorStatus   setVisibility(UcDb::Visibility newVal,
                                              ZSoft::Boolean doSubents = true);

    virtual void                list() const;
    virtual void                saveAs(UcGiWorldDraw* mode, UcDb::SaveType st);

    virtual Ucad::ErrorStatus	intersectWith(
                                        const UcDbEntity*   ent,
				                        UcDb::Intersect     intType,
				                        UcGePoint3dArray&   points,
                                        ZSoft::GsMarker     thisGsMarker  = 0,
                                        ZSoft::GsMarker     otherGsMarker = 0
                                                 ) const;
 
    virtual Ucad::ErrorStatus	intersectWith(
				                        const UcDbEntity*   ent,
				                        UcDb::Intersect     intType,
				                        const UcGePlane&    projPlane,
				                        UcGePoint3dArray&      points,
                                        ZSoft::GsMarker     thisGsMarker  = 0,
                                        ZSoft::GsMarker     otherGsMarker = 0
                                                 ) const;

    virtual void* getOleObject(void) const;
    virtual void setOleObject(const void *pItem);

    virtual void getLocation(UcGePoint3d& point3d) const;

    void setLocation(const UcGePoint3d& point3d);

    virtual void position(CRectangle3d& rect3d) const;

    virtual void setPosition(const CRectangle3d& rect3d);

    virtual void position(RECT& rect) const;

    virtual void setPosition(const RECT& rect);

    virtual void getUserType(ZTCHAR * pszName, int nNameSize) const;

    virtual int getType(void) const;

    virtual ZSoft::Boolean getLinkName(ZTCHAR * pszName, int nNameSize) const;

    virtual ZSoft::Boolean getLinkPath(ZTCHAR * pszPath, int nPathSize) const;

    virtual ZSoft::UInt8 outputQuality() const;
    virtual void setOutputQuality(ZSoft::UInt8);

	ZSoft::Boolean autoOutputQuality() const;
	void setAutoOutputQuality(ZSoft::UInt8);

    double rotation() const;
    Ucad::ErrorStatus setRotation(const double rotation);

    double wcsWidth() const;
    Ucad::ErrorStatus setWcsWidth(const double wcsWidth);

    double wcsHeight() const;
    Ucad::ErrorStatus setWcsHeight(const double wcsHeight);

    double scaleWidth() const;
    Ucad::ErrorStatus setScaleWidth(const double scaleWidth);

    double scaleHeight() const;
    Ucad::ErrorStatus setScaleHeight(const double scaleHeight);

    ZSoft::Boolean lockAspect() const;
    Ucad::ErrorStatus setLockAspect(const ZSoft::Boolean bLockAspect);

    virtual Ucad::ErrorStatus getClassID(CLSID* pClsid) const;

    virtual bool castShadows() const;
    virtual void setCastShadows(bool newVal);
    virtual bool receiveShadows() const;
    virtual void setReceiveShadows(bool newVal);
};

#pragma pack (pop)

#endif  
